<?php

/**
 * schooldept
 *  
 * @author ovo
 * @version 
 */


class Admin_Model_DbTable_schooldept extends Zend_Db_Table_Abstract {
	/**
	 * The default table name 
	 */
	protected $_name = 'school_dept';

	
	protected $_referenceMap = array (
	
			'School' => array(
			'columns' =>'school_id',
			'refTableClass' => 'Admin_Model_DbTable_School', 
			'refColumns'	=> 'id'
			
	),
	
			'Dept' => array (
			'columns' => 'dept_id',
			'refTableClass' => 'Admin_Model_DbTable_Department',
			'refColumns'	=> 'id'
	
	)
	
	);
	
	
	/**
	 * This function associates a school with a particular department
	 * @param  $schoolid : The School id
	 * @param  $deptid: The Department id.
	 */
	public function schoolDepts($schoolid, $deptid) {
		
		$data = array (
		 'school_id' => $schoolid,
		 'dept_id' => $deptid
		);
		
		$this->insert($data);
	}
	
	
}

